<template>
  <div class="hero-view">
    <BaseBox>
      <template #title>
        <BaseTitle>英雄百科</BaseTitle>
      </template>
      <template>
        <!-- 筛选盒子 -->
        <ul class="filter-box">
          <!-- 免费区域 -->
          <li class="free-box">
            <BaseTabs v-model="freeType" :tabs="freeTabs" />
          </li>
          <li>
            <!-- 定位区域 -->
            <div class="tab-box">
              <BaseTabs v-model="heroType" :tabs="typeTabs" />
            </div>
            <!-- 关键字检索 -->
            <div class="search-box">
              <BaseInput placeholder="查询" />
            </div>
          </li>
        </ul>
        <!-- 列表 -->
        <ul class="list-wrap">
          <li class="item" v-for="item in 155">
            <img src="http://game.gtimg.cn/images/lol/act/img/champion/Annie.png" alt="" />
            <p>黑暗之女</p>
          </li>
        </ul>
      </template>
    </BaseBox>
  </div>
</template>

<script>
export default {
  name: 'HeroView',
  data() {
    return {
      freeType: '',
      freeTabs: [
        {
          value: '',
          text: '全部',
        },
        {
          value: '0',
          text: '本周免费',
        },
      ],
      heroType: '',
      typeTabs: [
        {
          value: '',
          text: '全部',
        },
        {
          value: 'fighter',
          text: '战士',
        },
        {
          value: 'mage',
          text: '法师',
        },
        {
          value: 'assassin',
          text: '刺客',
        },
        {
          value: 'tank',
          text: '坦克',
        },
        {
          value: 'marksman',
          text: '射手',
        },
        {
          value: 'support',
          text: '辅助',
        },
      ],
    }
  },
}
</script>

<style lang="less" scoped>
.hoverShadow () {
  transition: all 0.5s;
  cursor: pointer;
  &:hover {
    transform: translate3d(0, -3px, 0);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  }
}
.hero-view {
  .filter-box {
    margin-bottom: 10px;
    background-color: #f0f2f5;
  }
  .filter-box li {
    display: flex;
    align-items: center;
    height: 50px;
    .base-tab {
      margin-right: 10px;
    }
    &:before {
      content: '综合';
      color: white;
      display: inline-block;
      text-align: center;
      line-height: 40px;
      width: 80px;
      height: 100%;
      background-color: #2c88e2;
      margin-right: 10px;
    }
    &:first-child:before {
      border-top-left-radius: 10px;
    }

    &:last-child {
      &:before {
        border-bottom-left-radius: 10px;
      }
    }
  }
  .list-wrap {
    display: flex;
    flex-wrap: wrap;
    padding-left: 20px;
    .item {
      height: 120px;
      width: 120px;
      margin-bottom: 30px;
      padding: 10px 15px 0;
      .hoverShadow();
      img {
        display: block;
        border: 2px solid #2c88e2;
        width: 100%;
      }
      p {
        text-align: center;
        font-size: 13px;
      }
    }
  }
}
</style>
